package com.zkh.myframe.database.mapper;

import java.util.ArrayList;
import com.zkh.myutils.page.Pagination;

/**
 * Mapper分页响应类
 * @author zkh
 */
public class MapperPageResponse<T> extends Pagination<T> {
	
	/**
	 * 获取一个空响应对象
	 * @param beanClass 数据Bean的class
	 * @param pageItem 每页条数
	 */
	public static <T> MapperPageResponse<T> getEmptyResponse(Class<T> beanClass, int pageItem){
		//初始化响应对象
		MapperPageResponse<T> pageResponse = new MapperPageResponse<T>();
		//初始化数据
		pageResponse.setPageIndex(1);
		pageResponse.setPageItem(pageItem);
		pageResponse.setDataList(new ArrayList<T>());
		//返回空对象
		return pageResponse;
	}
	@Override
	public String toString() {
		return "MapperPageResponse [totalItem=" + getTotalItem() + ", pageItem=" + getPageItem() + ", pageIndex=" + getPageIndex()
				+ ", totalPage=" + getTotalPage() + ", dataList=" + getDataList() + "]";
	}
}
